"""
-------------------------------------------
@ File          : vcode.py
@ Version       : V 0.1
@ time          : 2020-3-19  20:44
@ Tool          ：PyCharm
@ Author        ：Haomingju
@ Email         : haomingju @ gmail.com
@ Description   : 生成200个验证码
-------------------------------------------
"""

import random
import string

vcode_numbers = int(input("How many vcodes do you want: "))
vcode_length = int(input("What is the length of vcode: "))
code_set = ''.join(string.ascii_letters + string.digits)
vcode = []

while True:
    temp_code = ''.join(random.choices(code_set, k=vcode_length))
    if temp_code not in vcode:
        if len(vcode) < vcode_numbers:
            vcode.append(temp_code)
        else:
            break

for i in range(vcode_numbers):
    print("vcode({}): {}".format(i + 1, vcode[i]))
